using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class RecallMap : EntityTypeConfiguration<Recall>
    {
        public RecallMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Cust_ID)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.Procedure)
                .HasMaxLength(50);

            this.Property(t => t.Phyid)
                .IsRequired()
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("Recall");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Cust_ID).HasColumnName("Cust_ID");
            this.Property(t => t.DateAdded).HasColumnName("DateAdded");
            this.Property(t => t.Rec_Period).HasColumnName("Rec_Period");
            this.Property(t => t.Procedure).HasColumnName("Procedure");
            this.Property(t => t.Phyid).HasColumnName("Phyid");
            this.Property(t => t.Status).HasColumnName("Status");
        }
    }
}
